package zkk.com.mengqu.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import zkk.com.mengqu.App;
import zkk.com.mengqu.R;

/**
 * Created by Administrator on 2017/4/22.
 * 菜品评价设配器
 */
public class FoodCommentAdapter extends BaseAdapter {
    private Context context;

    public FoodCommentAdapter(Context context){
        this.context = context;
    }

    @Override
    public int getCount() {
        return 5;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if (convertView == null){
            convertView = LayoutInflater.from(context).inflate(R.layout.item_kitchen_estimate_comment , null);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        }else {
            holder = (ViewHolder)convertView.getTag();
        }

        holder.time.setText(App.app().getTime());

        return convertView;
    }

    class ViewHolder{
        TextView time;
        ViewHolder(View view){
            time = (TextView)view.findViewById(R.id.tx_time);
        }
    }
}
